(function () {
    $('#submit_article').on('click', function () {
        var title = $('#title').val()
        var id = $('#aId').val()
        swal({
            title: '确定?',
            text: "确定要上传该文章吗!",
            type: 'warning',
            showCancelButton: true,
            cancelButtonText: '取消',
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: '确定!'
        }).then(function (result) {
            if (result.value) {
                $.ajax({
                    url: base + '/articleManage/update',
                    type: 'post',
                    data: {articleId: id, articleHtml: quill.root.innerHTML, title: title},
                    success: function (result) {
                        if (result == 1) {
                            swal({
                                text: "更新成功!",
                            });
                            window.location.href = base + "/articleManage/index";
                        } else {
                            swal({
                                text: "更新失败!",
                            })
                        }
                    }, error: function () {

                    }
                })
            }
        })

    })

})()